home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
F1 Licenseware
/
F1 Licenseware - Volume 1.iso
/
disks
/
089a.dms
/
089a.adf
/
example.lha
/
DrunkenDuncan.AMOS
/
DrunkenDuncan.amosSourceCode
Wrap
AMOS Source Code
|
1992-02-26
|
3KB
|
116 lines
' ********************
' * Drunken Duncan *
' * by Mike Richmond *
' ********************
'
' v1.00
'
' Any similarities between this program and the editor of AMOSZINE are
' commpletely deliberate.
'
' Left to its own devices this program creates a sort of Pseudo-map, but
' its movement is almost completely random. Duncan (the drunkard) either
' goes straight on, turns left or turns right. His basic aim is to go in
' a straight line. By decreasing the DRUNKENESS variable you can alter
' the program so he is more likely to go in a straight line, or so he is
' completely out of his head and basically goes where he wants. DRUNKENESS
' should at least 2 if you want Duncan to be able to move in a straight
' line
'
' If you change the value of HIED to 1 then Duncan's travels are not
' shown as a solid line but as a moving dot. Actually, it looks quite
' like a small fly (have you ever noticed how flies seem to fly in circles
' just like Duncan does in this program?) An interesting thought.
'
' This isn't just Drunken, this is a fully fledged FLY SIMULATOR. Sim Fly,
' I might call it... BUY SIM FLY AND CREATE REAL LIFE ON YOUR AMIGA!
'
' This program is totally pointless but provides an interesting example
' of ordered randomness
'
' In time, Duncan will have walked over every pixel on the screen. Quite
' a long time, I think!
'
' Hold the left mouse button to return to the editor
'
DRUNKENESS=5 : Rem smaller numbers=more drunk
HIED=0 : Rem if HIED=1 then a solid line is not drawn
'
'
'
Screen Open 0,320,200,2,Lowres
Palette $0,$FFF : Flash Off : Curs Off : Hide
X=Rnd(319) : Y=Rnd(199)
' Random start coordinates for Dunc.
RAND:
DI=Rnd(8)
If DI=0 Then Goto RAND
' A random start direvtion for Duncan
'
Ink 1
Repeat
OX=X : OY=Y
T=Rnd(DRUNKENESS)
If T=0 Then Dec DI
If T=1 Then Inc DI
' A value of 0 or 1 turns him round. Anything else and he continues
' in a straight line
'
If DI<1 Then DI=1
If DI>8 Then DI=8
' Make sure the direction he is rravelling in is valid
'
If DI=1 Then Dec Y
If DI=2
Dec Y
Inc X
End If
If DI=3 Then Inc X
If DI=4
Inc X
Inc Y
End If
If DI=5 Then Inc Y
If DI=6
Inc Y
Dec X
End If
If DI=7 Then Dec X
If DI=8
Dec X
Dec Y
End If
' Move Duncan
'
If X<0 Then X=319
If X>319 Then X=0
If Y<0 Then Y=199
If Y>199 Then Y=0
' Wraparound screen
Ink 1 : Plot X,Y
' Put Dunc. on the screen
'
If HIED=1
Ink 0
Plot OX,OY
End If
' If HIED=1 delete the old Duncan from the screen. Unfortunately it
' looks like there are two dots because the screen is not double
' buffered. Oh well...
'
Until Mouse Key<>0
'
Cls 0
Home : Cdown : Cdown : Cdown : Cdown : Cdown
Pen 1 : Centre "Drunken Duncan v1.00"
Cdown : Cdown : Cdown : Cdown
Centre "Another great program from..."
Cdown : Cdown : Cdown : Cdown
Centre "RipperSoft"
Cdown : Cdown : Cdown : Cdown
Centre "Press mouse to return to editor"
Wait 25
Repeat
Until Mouse Key<>0
Fade 2
Edit